﻿using System.Runtime.Serialization;
using System.Xml.Serialization;

namespace BusinessObjects
{
#if Silverlight
    [Serializable]
#else
    [DataContract]
#endif
    public class RegionObjectHolder
    {
        public RegionObjectHolder()
            : this( 0, 0, 0 )
        {
        }

        public RegionObjectHolder( int rId, int x, int y )
        {
            this.RegionObjectId = rId;
            this.X = x;
            this.Y = y;
        }

        public int RegionObjectId
        {
            get;
            set;
        }

        public int X
        {
            get;
            set;
        }

        public int Y
        {
            get;
            set;
        }

        public override bool Equals( object obj )
        {
            RegionObjectHolder roh = obj as RegionObjectHolder;

            if ( roh == null )
                return false;

            return roh.RegionObjectId == this.RegionObjectId && roh.X == this.X && roh.Y == this.Y;
        }
    }
}
